/**
 *
 */
package gen;


public class Question {

    private String id;
    private String name;
    private String url;
    private String solutionNum;
    private String solutionUrl;
    private String percentOfPass;
    private String levelMedium;
    private String context;


    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("/**\n")
                .append(" * #      ").append(id).append("\n")
                .append(" * 名称   ").append(name).append("\n")
                .append(" * 链接   ").append(url).append("\n")
                .append(" * 题解   ").append("[").append(solutionNum).append("]").append("(").append(solutionUrl).append(")").append("\n")
                .append(" * 通过率 ").append(percentOfPass).append("\n")
                .append(" * 难道   ").append(levelMedium).append("\n")
                .append(" */").append("\n").append("\n")
                .append(context);
        return sb.toString();
    }


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getSolutionNum() {
        return solutionNum;
    }

    public void setFolderName(String floderName) {

    }

    public String getFolderName() {
        if (id == null) {
            return null;
        }
        return "p" + id.replace("剑指", "jz").replace("面试题", "mst")
                .replace(".", "_").replace(" ", "_")
                .replace("-", "_").toLowerCase();
    }


    public void setSolutionNum(String solutionNum) {
        this.solutionNum = solutionNum;
    }

    public String getSolutionUrl() {
        return solutionUrl;
    }

    public void setSolutionUrl(String solutionUrl) {
        this.solutionUrl = solutionUrl;
    }

    public String getPercentOfPass() {
        return percentOfPass;
    }

    public void setPercentOfPass(String percentOfPass) {
        this.percentOfPass = percentOfPass;
    }

    public String getLevelMedium() {
        return levelMedium;
    }

    public void setLevelMedium(String levelMedium) {
        this.levelMedium = levelMedium;
    }

    public String getContext() {
        return context;
    }

    public void setContext(String context) {
        this.context = context;
    }
}
